package bb.lanxing.lib.devices.utils;

import android.content.Context;
import android.content.Intent;
import bb.lanxing.lib.devices.api.PeerDevice;

public class DeviceCompat {
    public static void notifyBattery(Context context, PeerDevice peerDevice, int i) {
        if (context == null || peerDevice == null) {
            return;
        }
        Intent intent = new Intent("ACTION_BATTERY");
        intent.putExtra("EXTRA_DEVICE_TYPE", peerDevice.getType());
        intent.putExtra("EXTRA_BATTERY", i);
        intent.putExtra("EXTRA_DEVICE_ADDRESS", peerDevice.getAddress());
        intent.setPackage(context.getPackageName());
        context.sendBroadcast(intent);
    }

    public static void notifyFirmwareVersion(Context context, PeerDevice peerDevice, String str) {
        if (context == null || peerDevice == null) {
            return;
        }
        Intent intent = new Intent("ACTION_DEVICE_INFORMATION");
        intent.putExtra("EXTRA_DEVICE_TYPE", peerDevice.getType());
        intent.putExtra("EXTRA_DEVICE_INFORMATION", str);
        intent.putExtra("EXTRA_DEVICE_ADDRESS", peerDevice.getAddress());
        intent.setPackage(context.getPackageName());
        context.sendBroadcast(intent);
    }
}
